<template name="order">
	<div class="f7-order-top">
		<div id="all" class="f7-order-top-row">
			<img src="/img/all.png"/>
			<p>所有订单</p>
		</div>
		<div id="nopay" class="f7-order-top-row">
			<img src="/img/nopay.png"/>
			<p>待付款</p>
		</div>
		<div id="pay" class="f7-order-top-row">
			<img src="/img/comment.png"/>
			<p>已付款</p>
		</div>
		<div id="refunded" class="f7-order-top-row">
			<img src="/img/refunded.png"/>
			<p>退款</p>
		</div>
	</div>
	<div class="f7-order-content" style="padding-bottom:70px">
		<div class="list-block media-list f7-order-list">
			{{#if orderList}}
			<ul>
				{{#each orderList}}
				<li data-id="{{id}}">
					<div class="item-link item-content">
						<div class="item-media" data-id="{{id}}">
								<img src="{{merchant.list_image.path}}" height="55px" width="50px" />
						</div>
						<div class="item-inner">
							<div class="item-title-row" data-id="{{id}}" style="background-image:none">
								<div class="item-title" style="font-size:18px;">{{merchant.name}}</div>
								<div class="item-after" style="font-size:13px;">

								</div>
							</div>
								<div class="item-text" style="font-size:13px;padding-top:4px">
									{{#if gorefund state}}
									<span class="order-time" data-id="{{id}}">支付时间:{{pay_time}}</span>
									{{else}}
									<span class="order-time" data-id="{{id}}">下单时间:{{created_at}}</span>
									{{/if}}
								</div>
								<div class="item-text" style="font-size:13px;padding-top:4px">
									<span class="order-time" data-id="{{id}}">
									订单状态：{{orderState state}}
									</span>
										<span class="f7-item-after" style="height:24px;float:right;">
											{{#if is_comment}}
												<a href="/orderComment?order_id={{id}}&user_id={{user_id}}">去评价</a>
											{{/if}}
											{{#if gopay state}}
<a href="/payment?order_id={{id}}&order_no={{order_no}}&mname={{merchant.name}}&pay_fee={{pay_fee}}&list_image={{merchant.list_image.path}}">去支付</a>
											{{/if}}
											{{#if gorefund state}}
											<a href="/refund/{{id}}">退款</a>
											{{/if}}
										</span>
								</div>
								<div  class="order-time" data-id="{{id}}" style="font-size:13px;width:100%">
								总价(￥)：{{total_fee}}&nbsp;&nbsp;&nbsp;&nbsp;实付(￥)：{{pay_fee}}
							</div>
						</div>
					</div>
				</li>
				{{/each}}
			</ul>
			{{else}}
			{{>noData}}
			{{/if}}
		</div>
	</div>
</template>
